# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Santiago Torres-Arias <santiago[at]archlinux[dot]org>
# Contributor: Aaron McDaniel (mcd1992) <'aur' at the domain 'fgthou.se'>

pkgname=iaito
_gitcommit=805db97abdd453592021b0b4e812d6a806914fd5
_transcommit=e66b3a962a7fc7dfd730764180011ecffbb206bf
pkgver=5.8.4
pkgrel=1
pkgdesc='Qt and C++ GUI for radare2 reverse engineering framework'
url='https://github.com/radareorg/iaito'
arch=('loong64' 'x86_64')
license=('GPL3')
depends=('radare2' 'capstone' 'qt5-base' 'qt5-svg' 'python'
         'pyside2' 'python-shiboken2' 'graphviz' 'gcc-libs')
makedepends=('git' 'shiboken2' 'qt5-tools')
optdepends=('r2ghidra: ghidra decompiler plugin')
replaces=('r2cutter')
source=("git+https://github.com/radareorg/iaito#commit=${_gitcommit}"
        "git+https://github.com/radareorg/iaito-translations#commit=${_transcommit}"
        no-rpath.patch)
sha512sums=('SKIP'
            'SKIP'
            '242eb0c73e2dda645f620cf8ae4039ea8fb9e25ddca6ec3507c100f4193e4ee3e2ae11269a5b2cfec47f15e99769b27f8262ba30c088e017cffaef756d6ee464')
b2sums=('SKIP'
        'SKIP'
        'b433afbb858d001a6909cb49f5cc42bc85f6bb185a7508f8dd42c4258b7b6ae44d4436b4e2e3f9c272d6e7b97d760510d719eaccd10e20cda2cac544cd9765f4')

pkgver() {
  cd iaito
  git describe --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cp -r iaito-translations iaito/src/translations
  patch -d iaito -Np1 < no-rpath.patch
}

build() {
  cd iaito
  ./configure --prefix=/usr
  mkdir build
  cd build
  qmake-qt5 ../src PREFIX=/usr
  make
}

package() {
  cd iaito
  make -C build INSTALL_ROOT="$pkgdir" install
  make DESTDIR="$pkgdir" PREFIX=/usr install-translations install-man
}

# vim: ts=2 sw=2 et:
